<div class="common_left COM_discounts">
    <div class="discounts_type">
        <dl>
            <dt><i>分类：</i> <a class ="{:hover_css( 0, 'cat' )}" href="{:urlParamChange('cid', $_GET['cid'], '')}">全部</a></dt>
            <dd>
            <volist name="cat" id="cat">
                <a class ="{:hover_css( $cat['cat_id'], 'cat' )}" href="{:urlParamChange('cid', $_GET['cid'], $cat['cat_id'])}">{$cat.name}</a>
            </volist>
            </dd>
        </dl>
        <dl>
            <dt><i>地区：</i> <a href="{:urlParamChange('aid', $_GET['aid'], '')}" class="{:hover_css( 0, 'area' )}">全部</a></dt>
            <dd>
            <volist name="area" id="ar">
                <a class ="{:hover_css( $ar['area_id'], 'area' )}" href="{:urlParamChange('aid', $_GET['aid'], $ar['area_id'])}">{$ar.name}</a>
            </volist>
            </dd>
        </dl>
    </div>
    <div class="clear"></div>
    <div class="discounts_search">
        <div class="keyword">热门关键字：<a href="#">餐饮美食</a> <a href="#">购物</a> <a href="#">住宿</a> <a href="#">休闲娱乐</a> <a href="#">婚庆影楼</a></div>
        <form action="{:U('Dazhe/index')}" method="post" id="form">
            <div class="title">搜索</div>
            <select name="shop_id">
                <volist name="shop" id="sp">
                    <option value="{$sp.shop_id}">{$sp.shop_name}</option>
                </volist>

            </select>
            <i></i>
            <input class="txt" type="text" value="请输入关键字" name="search">
            <input type="image" src="__PUBLIC_HOME__/images/but2.jpg">
        </form>
    </div>
    <div class="clear"></div>
    <ul class="discounts_list">
        <volist name="data.list" id="ls">
            <li>
                <div class="img"><img src="{$ls.img_url}"><p><a href="{:U('Home/Dazhe/show', array('id'=>$ls['dazhe_id']))}">{$ls.cat_name}</a></p></div>
                <dl>
                    <dt><a href="{:U('Home/Dazhe/show', array('id'=>$ls['dazhe_id']))}">{$ls.description|str_cut=50, '...'}</a></dt>
                    <dd>地址:{$ls.address|str_cut=36, '...'}</dd>
                    <dd>电话：{$ls.phone}</dd>
                    <dd>时间：{$ls.star_time|date="Y-m-d", ###}</dd>
                    <dd  class="COL"><a href="javascript:favorite({$ls.dazhe_id}, 'dazhe', '{$ls.description|str_cut=50, '....'}', '{:U('Home/Dazhe/show', array('id'=>$ls['dazhe_id']))}')">我要收藏</a></dd>
                </dl>
            </li>     
        </volist>
    </ul>

    <div class="clear"></div>   
    <div class="pagination paginationa" id="pagination">
        <a href="javascript:loadDZ()" class="dp" title="更多"></a>
        <a href="javascript:loadDZ('page', 1)" class="sp" id="page_num_a">试试页码翻页</a>
    </div>
</div>
<style type="text/css">
    .paginationa .dp{border: 0px;}
    .paginationa .dp:hover{border: 0px;}
    .pagination{padding-left: 0px; width: 720px;}
    #page_num_a span{
        border: 1px solid #E3E3E3;
        color: #333333;
        display: inline-block;
        font-family: 'simSun';
        margin-right: 20px;
        padding: 6px 10px;
    }
    #page_num_a span:hover{
        border:1px solid #fc6f0b;background:#fc6f0b; color:#fff; text-decoration:none;
    }
</style>

<script type="text/javascript">
    var p = 2;
    function loadDZ(type, page){
        p = (typeof(page) == 'undefined')? p: page;
        jQuery.ajax({
            url: '{:get_url()}&page='+p,
            type: 'POST',
            dataType: 'json',
            success: function(data, textStatus, xhr) {
                var list = data['list'];
                var html = '';
                for(var i=0; list.length > i; i++){
                    html += '<li>'
                        +' <div class="img"><img src="'+list[i]['img_url']+'"><p><a href="/home/dazhe/show/id/'+list[i]['dazhe_id']+'.html">'+list[i]['cat_name']+'</a></p></div>'
                        +' <dl>'
                        +'     <dt><a href="/home/dazhe/show/id/'+list[i]['dazhe_id']+'.html">'+list[i]['description']+'</a></dt>'
                        +'     <dd>地址:'+list[i]['address']+'</dd>'
                        +'     <dd>电话：'+list[i]['phone']+'</dd>'
                        +'     <dd>时间：'+getLocalFormatTime(list[i]['star_time'])
                        +'     <dd  class="COL"><a href="javascript:favorite('+list[i]['dazhe_id']+', \'dazhe\')">我要收藏</a></dd>'
                        +' </dl>'
                        +'</li> ';
                }
                if(html){
                    if(type=='page'){
                        //$("#page_num_a").html('<span>'+p+'</span>');
                        var pagehtml = '<div class="pager">';
                        for(var i=1; i<= data['totalPage']+1; i++){
                            if(i == data['nowPage']){
                                pagehtml += '<span class="current" >'+i+'</span>';
                            }else {
                                pagehtml += '<a href="javascript:void(0);" onclick="javascript:loadDZ(\'page\', \''+i+'\')">'+i+'</a>';
                            }
                        }
                        $("#pagination").html(pagehtml+'<a href="javascript:loadDZ(\'0\',1)" class="sp" id="page_num_a">试试滚动翻页</a>')
                        p++;
                        $(".discounts_list").html(html)
                    }else{
                        $("#pagination").html('<a href="javascript:loadDZ()" class="dp" title="更多"></a><a href="javascript:loadDZ(\'page\', 1)" class="sp" id="page_num_a">试试页码翻页</a>')
                        p++;
                        if(page == 1){
                            $(".discounts_list").html(function(){
                                $(this).html(html);                            
                            });
                        }else{
                            $(".discounts_list").html(function(){
                                $(this).html($(".discounts_list").html()+html);                            
                            });
                        }
                    }
                }else {
                    art.dialog({
                        lock: true,
                        background: '#000', // 背景色
                        opacity: 0.87,	// 透明度
                        content: '加载完毕木有更多了......',
                        icon: 'succeed',
                    });
                }
                
            },
            error: function(xhr, textStatus, errorThrown) {
                //called when there is an error
            }
        });
    }
    function getLocalFormatTime(nS) {  
        return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");   
    }
</script>
<!----> 
<div class="common_right">
    <div class="Cad"><a href="{:U('User/Dazhe/fabu')}" title="免费发布打折信息"><img src="__PUBLIC_HOME__/images/but4.jpg"></a></div>
    <div class="Cad martop10">{:getBlock('common_right_ad2')}</div>
    <include file="Public:round" />
</div>
<!---->
<div class="clear"></div>
</div>